import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '姓名',
    align:"center",
    sorter: true,
    dataIndex: 'name'
   },
   {
    title: '手机',
    align:"center",
    sorter: true,
    dataIndex: 'mobile'
   },
   {
    title: '账户',
    align:"center",
    dataIndex: 'accNo'
   },
   {
    title: '身份证',
    align:"center",
    dataIndex: 'idcard'
   },
   {
    title: '第二联系人',
    align:"center",
    dataIndex: 'name2'
   },
   {
    title: '第二联系人手机',
    align:"center",
    dataIndex: 'mobile2'
   },
   {
    title: '住址',
    align:"center",
    dataIndex: 'address'
   },
   {
    title: '类型',
    align:"center",
    dataIndex: 'type'
   },
   {
    title: '项目id',
    align:"center",
    dataIndex: 'projectId'
   },
   {
    title: '排序',
    align:"center",
    dataIndex: 'numOrder'
   },
   {
    title: '备注',
    align:"center",
    dataIndex: 'notes'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "姓名",
      field: 'name',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "手机",
      field: 'mobile',
      component: 'Input',
      //colProps: {span: 6},
 	},
	{
      label: "身份证",
      field: 'idcard',
      component: 'Input',
      //colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '姓名',
    field: 'name',
    component: 'Input',
  },
  {
    label: '手机',
    field: 'mobile',
    component: 'Input',
  },
  {
    label: '账户',
    field: 'accNo',
    component: 'Input',
  },
  {
    label: '身份证',
    field: 'idcard',
    component: 'Input',
  },
  {
    label: '第二联系人',
    field: 'name2',
    component: 'Input',
  },
  {
    label: '第二联系人手机',
    field: 'mobile2',
    component: 'Input',
  },
  {
    label: '住址',
    field: 'address',
    component: 'Input',
  },
  {
    label: '类型',
    field: 'type',
    component: 'InputNumber',
  },
  {
    label: '项目id',
    field: 'projectId',
    component: 'Input',
  },
  {
    label: '排序',
    field: 'numOrder',
    component: 'InputNumber',
  },
  {
    label: '备注',
    field: 'notes',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  name: {title: '姓名',order: 0,view: 'text', type: 'string',},
  mobile: {title: '手机',order: 1,view: 'text', type: 'string',},
  accNo: {title: '账户',order: 2,view: 'text', type: 'string',},
  idcard: {title: '身份证',order: 3,view: 'text', type: 'string',},
  name2: {title: '第二联系人',order: 4,view: 'text', type: 'string',},
  mobile2: {title: '第二联系人手机',order: 5,view: 'text', type: 'string',},
  address: {title: '住址',order: 6,view: 'text', type: 'string',},
  type: {title: '类型',order: 7,view: 'number', type: 'number',},
  projectId: {title: '项目id',order: 8,view: 'text', type: 'string',},
  numOrder: {title: '排序',order: 9,view: 'number', type: 'number',},
  notes: {title: '备注',order: 10,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}